{include file="header"}
<style>
    .layui-btn-danger{
        margin-left: 0;
    }
</style>
<div class="x-nav" >
           <span class="layui-breadcrumb">
<!--            <a href="">{:lang("system")}</a>-->
<!--            <a href="">TV管理</a>-->
            <a>
                <cite style="font-size: 18px;">剧集管理</cite>
            </a>
          </span>
    <a class="layui-btn layui-btn-small" href="/" style="line-height:1.6em;margin-top:3px;float:right"  title="返回主页">
        <i class="layui-icon" style="line-height:30px">返回主页</i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form method="get" action="{:url('television/dramaList')}" class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" class="layui-input" style="width: 200px;" name="keyName" placeholder="输入标题（中文/日文）进行搜索" value="{:request()->get('keyName',null)}">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn" type="submit"><i class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                </div>
<!--                <div class="layui-card-header">-->
<!--                    <button class="layui-btn" onclick="parent.xadmin.open('添加聚合','{:url("Television/dramaAdd")}')"><i class="layui-icon"></i>添加作品名</button>-->
<!--                </div>-->
                <div class="layui-card-body">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>作品名</th>
                            <th>话数</th>
                            <th>话数内容</th>
                            <th>标题（中文）</th>
                            <th>标题（日文）</th>
                            <th>首更日期</th>
                            <th>播出电视台</th>
                            <th>剧集长度</th>
                            <th>剧集类型</th>
                            <th>漫画单行本话数</th>
                            <th>漫画总话数</th>
                            <th>{:lang('action')}</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name="lists" id="item"}
                        <tr class="tr_{$item.id}">
                            <td>{$item.id}</td>
<!--                            <td>{$item.pid}</td>-->
                            <td>{$item.name}</td>
                            <td>{$item.number_type == 1?"季番":($item.number_type == 2?"常规":"特殊")}</td>
                            <td>{$item.number_desc}</td>
                            <td>{$item.name_cn}</td>
                            <td>{$item.name_rw}</td>
                            <td>{$item.first_date} {$item.first_date_week}</td>
                            <td>{$item.broadcast_tv}</td>
                            <td>{$item.drama_length_msg}</td>
                            <td>{$item.drama_type== 1?"原作漫改":($item.number_type == 2?"动画组原创":($item.number_type == 3?"停播":"重播"))}</td>
                            <td>{$item.comics_single}</td>
                            <td>{$item.comics_total}</td>
                            <td>
                                <a href="javascript:;" class="rnglj" onclick="xadmin.open('修改剧集','{:url("Television/dramaedit",["id"=>$item["id"],"pid"=>$item["pid"]])}')">{:lang('edit')}</a>&nbsp;&nbsp;|
                                <a href="javascript:;" class="rnglj" onclick="xadmin.open('查看剧集','{:url("Television/dramasee",["id"=>$item["id"],"pid"=>$item["pid"]])}')">查看</a>&nbsp;&nbsp;|
                                <a href="javascript:;" class="rnglj" onclick="del('{$item.id}')">{:lang('del')}</a>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    {$lists|raw}
                </div>
            </div>
        </div>
    </div>
</div>

{include file="footer"}
<script>
    function del(id) {
        layer.confirm("{:lang('del.confirm')}",{icon: 3, title:'{:lang("tips")}'},function (index) {
            layer.close(index);
            request("POST",'{:url("television/dramadel")}',{
                id:id
            },function (res) {
                $(`.tr_${id}`).remove()
            })

        })
    }
</script>